package org.duiduo.controller;

import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.duiduo.result.LogResultClass;
import org.duiduo.result.ResultData;
import org.duiduo.result.ResultStringClass;
import org.duiduo.service.LintongProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;

/**
 * @Description TODO
 * @Author lengshuangze
 * @Date 2020/11/21 19:50
 * @Version 1.0
 */
@RestController
@RequestMapping("/lintong")
@Log4j2
public class LintongProjectController {

    @Autowired
    private LintongProjectService lintongProjectService;

    /***
     * 创建邻通生活项目文件夹 - 不传走默认V2.0.3
     * @param version: 版本号
     * @return
     */
    @GetMapping
    public ResultData lintongProjectCreate(@RequestParam(defaultValue = "") String version) {
        ResultData resultData = new ResultData();
        try {
            resultData = lintongProjectService.createFolder(version);
            return resultData;
        } catch (Exception e) {
            e.printStackTrace();
            log.error(LogResultClass.SYS_ERROR, e.getMessage());
        }
        return resultData;
    }
}
